#!/bin/bash

echo "=== HBase集群状态检查 ==="
echo ""

# 检查HBase版本
echo "1. HBase版本信息:"
hbase version
echo ""

# 检查HBase Master状态
echo "2. HBase Master状态:"
jps | grep HMaster
echo ""

# 检查RegionServer状态
echo "3. RegionServer状态:"
jps | grep HRegionServer
echo ""

# 检查ZooKeeper状态
echo "4. ZooKeeper状态:"
jps | grep QuorumPeerMain
echo ""

# 检查HBase Web UI
echo "5. HBase Web UI地址:"
echo "   Master UI: http://$(hostname -I | awk '{print $1}'):16010"
echo ""

# 检查集群状态
echo "6. 集群状态:"
hbase shell <<< "status"
echo ""

# 检查表状态
echo "7. 表状态:"
hbase shell <<< "list"
echo ""

# 检查RegionServer详细信息
echo "8. RegionServer详细信息:"
hbase shell <<< "status 'detailed'"
echo ""

echo "=== 检查完成 ===" 